package com.gxa.hualian.exception;

import com.gxa.hualian.common.ExceptionCode;

/**
 * @Author ChenJin
 * @date 2021/09/18 15:09
 * Description:业务异常
 **/
public class BusinessException extends Exception {
    private ExceptionCode exceptionCode;

    public ExceptionCode getExceptionCode() {
        return exceptionCode;
    }

    /**
     * 用枚举的方式自定义业务异常
     * @param exceptionCode
     */
    public BusinessException(ExceptionCode exceptionCode){
        super(exceptionCode.getMessage());
        this.exceptionCode=exceptionCode;
    }
}
